Skip to content

feat(pr): add resumable sequential merge batches - #2761

Merged
BigSimmo merged 6 commits into
mainfrom
codex/chat-pr-batch-runner-1076
Sep 11, 2026
Merged

feat(pr): add resumable sequential merge batches#2761
BigSimmo merged 6 commits into
mainfrom
codex/chat-pr-batch-runner-1076

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add a disabled-by-default sequential PR batch runner with a fixed snapshot, JSON state branch, event-driven reconciliation, bounded isolated repairs, and protected merge requests tied to the verified head.
  • Coordinate the existing PR operator and review auto-fix through shared ownership. Journal publication, replies, resolutions, and reruns so recovery does not blindly repeat external writes.
  • Add the Clear PRs repository shortcut and activation guide. Preserve migration, clinical/RAG, provider, and controller-policy exclusions.

Verification

Prior implementation checks (not repeated for this publication):

  • npm run test -- tests/pr-batch-runner.test.ts tests/pr-batch-github.test.ts tests/codex-run-pr-operator-workflow.test.ts tests/codex-autofix-workflow.test.ts — 124 tests passed.
  • npm run typecheck — passed.
  • Managed lint:changed:internal on changed scripts and tests with --max-warnings 0 — passed.
  • npm run check:github-actions and npm run check:codex-autofix-workflow — passed.
  • node scripts/update-docs-inventory.mjs --check and git diff --check — passed.
  • Verification not run: the full verify:pr-local suite; focused controller/operator tests and workflow guards cover the changed contracts. Hosted checks remain authoritative before merge.
  • UI verification not run: no application UI changes. Release, live-provider, and retrieval evaluations were not run; this PR does not change those behaviors.

Risk and rollout

  • Risk: automation publishes feature branches and requests production-triggering merges when separately activated. Offline tests do not establish live GitHub integration correctness.
  • Rollback: keep PR_BATCH_ENABLED absent/false or pause a batch. Pausing does not revoke an already-issued merge request; never silently disable user-owned auto-merge.
  • Provider or production effects: the new batch controller ships disabled. Existing operator/auto-fix ownership checks change on installation. Subsequent activation authorizes bounded repair API costs, GitHub writes, and resulting Railway deployments; no Supabase migrations are included.
  • RAG impact: none.
  • Rollout: publication only in this task. Merge, activation, and the initial pilot await the owner's later instruction. Existing armed PRs must settle before batch launch.

Clinical Governance Preflight

Not applicable to application behavior: no ingestion, clinical output, document access, privacy, source rendering, or production environment configuration changes. The batch eligibility checks preserve existing governance and migration restrictions.

Notes

  • Authorization reference: codex://threads/01a085a9-110d-7da2-be3c-12b16e2cf3ad.
  • Implementation is excluded from its own automatic merge batch because it changes controller and workflow policy.
  • Publication uses the repository's bare-PR route. The whole-repository format pass was interrupted when scope changed to publication only; changed-file formatting had already passed. No additional local checks or hosted CI observation are performed for publication.

Note

High Risk
When activated, the batch path authorizes GitHub writes, protected merges, repair API use, and Railway deployments; mistakes in ownership, signing, or publication could affect production merge flow.

Overview
Introduces a disabled-by-default sequential PR batch runner that snapshots eligible open PRs, journals work on an HMAC-authenticated codex/pr-batch-state branch, and drives one PR at a time through sync, bounded Codex repairs, review replies/resolutions, and protected merge requests (with optional RAG canary proof).

Codex Run PR and review auto-fix now share a pr-batch-mutation concurrency group and yield when a PR is batch-reserved. The operator gains optional batch_id / batch_operation inputs, can leave a pending base merge for batch repairs (compare tree vs. head for publication), requires progress_outcome in sealed results, and journals candidates plus batch-side mutations through pr-batch-worker.mjs.

Adds the Clear PRs agent shortcut and docs/pr-batch-runner.md activation guide, extends workflow/policy guards and CI tests (pr-batch-*.test.ts), and ignores .codex-run-pr/ in Prettier so sealed digests stay stable.

Reviewed by Cursor Bugbot for commit 92c0b81. Configure here.

@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 085c8e5e-aa04-4b8e-85d7-71d788d5d180


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@supabase

supabase Bot commented Sep 9, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-09T14:11:20.787595Z 49bcab6 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cursor

cursor Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_abeb2a10-ee34-4ebc-9302-3ac53a8102d3)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 49bcab61f3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/pr-batch-runner.yml Outdated
Comment thread scripts/pr-batch-core.mjs
Comment thread scripts/pr-batch-github.mjs Outdated
@BigSimmo

BigSimmo commented Sep 9, 2026

Copy link
Copy Markdown
Owner Author

@codex resolve actionable Codex review findings for this pull request and current head using the repository instructions. This is the pull request's single automatic repair pass: do not perform a fresh review, create new standalone findings, or request another review. Work only the existing unresolved Codex threads on the current head. The only repository destination is BigSimmo/Database, and the only branch destination is the pull request head branch codex/chat-pr-batch-runner-1076 at starting commit 49bcab6; never publish fixes to a detached or synthetic work branch and never create a stacked pull request. Use the authenticated GitHub connector to commit each approved fix to BigSimmo/Database:codex/chat-pr-batch-runner-1076, then verify that the pull request head contains the published commit before reporting success. Always fix P0 and P1 findings. For P2 and lower findings, fix only clear, scoped, low-risk issues; otherwise disposition them with a concise reason. For a fixed thread, reply with as the first line and as the second line. For a no-code disposition, use followed by . These result markers authorize the workflow to close that exact thread only after it verifies a fixed commit is the pull request head; a local-only commit is not a fix. If publication or verification fails, do not use either result marker, do not claim success, and leave the thread open with the blocker. If human input or new authorization is required, do the same. Finish only after every actionable thread is fixed or dispositioned and closed, or explicitly left open for a human decision. Do not update the branch from main, address unrelated reviews, broaden scope, or create more than one scoped fix commit. Do not use external APIs, paid services, credentials, dependency changes, or broad refactors unless explicitly authorized. Add targeted tests where behavior changes and run the narrowest relevant validation.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 49bcab61f3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

CI triage

CI failed on this PR. Automated classification of the 2 failed job(s):

  • Unit coverageneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.
  • PR requiredneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.

Compared with main CI run #16436 (failure).

Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger.

@cursor

cursor Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_d52f6e7e-e963-47d3-bdf3-14f52c665297)

@cursor

cursor Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_ac9acc3e-cd6f-489c-b36c-b01c29dd3340)

@BigSimmo
BigSimmo enabled auto-merge September 11, 2026 17:07
@BigSimmo
BigSimmo merged commit e23fbf6 into main Sep 11, 2026
61 checks passed
@BigSimmo
BigSimmo deleted the codex/chat-pr-batch-runner-1076 branch September 11, 2026 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant